package com.xxx.client.android.api.impl;

import java.util.ArrayList;
import java.util.List;

import org.ksoap2.serialization.SoapObject;

import com.xxx.client.android.api.MenuVO;

public class MenuVOFunctions {

	public static MenuVO getMenuVO(SoapObject soapObject)
			throws RuntimeException {
		return new MenuVOBuilder().build(soapObject);
	}

	public static List<MenuVO> getMenuVOList(Object respone)
			throws RuntimeException {
		if (respone != null) {
			@SuppressWarnings("unchecked")
			List<SoapObject> soapList = (List<SoapObject>) respone;
			ArrayList<MenuVO> list = new ArrayList<MenuVO>(soapList.size());
			for (SoapObject soapObject : soapList) {
				list.add(getMenuVO(soapObject));
			}

			return list;
		}
		return null;
	}
}
